<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="../common.jsp" %>
<script type="text/javascript">
	$(document).ready(function(){
		/* createLayoutForAddOrEdit('viewDocNorthPane','docDetailsTabs'); */
		setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');		
	});
</script>


<div align="center">
	<table class="bodyTable">
		<tr>
			<td>
				<table class="filtersTable zeroBorder" style="width: 100%;">
					<tr class="tableChildHeaderColor" align="left" style="width: 100%;">
						<td>
							<table style="width: 100%;" >
								<tr>
									<td style="width: 80%;">
										<table >
											<tr>
												<td class="spacingColumnWidthLess"></td>
												<td align="left">
													<!-- <img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-11.png"> -->
												</td>
												<td class="spacingColumnWidthLess"></td>
												<td style="vertical-align: middle;"><span class="tableMainHeaderFont">VIEW DOCUMENT</span></td>
											</tr>
										</table>
									</td>
									<td style="width: 20%;">
										<table class="zeroBorder" style="width: 100%;">
											<tr align="right">
												<td >
													<input type="button" class="formButton" value="Back" onclick="javascript:viewDocumentDetail('0','back');"/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr class="formSpacingRow formBlockColor"><td></td></tr>
					<tr>
						<td align="center">
						<div id="uploadDocTabs" class="formBlockColor"  style="overflow: auto;">
							<form:form commandName="renewalDetailsForm" id="viewDocForm" action="${flowExecutionUrl}" enctype="multipart/form-data" method="POST">
							<form:hidden path="docId" value="${renewalDetailsForm.docId}"/>
								<table style="width: 100%;" border="0" class="formTable" >
									
									<tr  align="left">
										<td class="spacingColumnWidthLess">&nbsp;</td>
										<td colspan="3" align="right">
											<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; text-align: left;">
												<span class="formLabel">Attached Document:&nbsp;</span>
												<c:choose>
													<c:when test="${activityStatus}">
														<a target="_blank" href="downloadAttachment/${renewalDetailsForm.docId}.htm">${renewalDetailsForm.docName}</a>
													</c:when>
													<c:otherwise>
														<ul class="userListClass">
															<li class="ui-state-default">${renewalDetailsForm.docName} (No Rights) </li>
														</ul>
													</c:otherwise>
												</c:choose>
												<c:if test="${(versionLinksMap ne null) and (fn:length(versionLinksMap) gt 0) }">
													<br>
													<span class="formLabel">Previous Versions:&nbsp;</span>
													<c:choose>
														<c:when test="${activityStatus}">
															<c:forEach items="${versionLinksMap}" var="versionLink">
																<a target="_blank" href="downloadLinkedAttachment/${renewalDetailsForm.docId}/${versionLink.key}.htm">${versionLink.value}</a>
															</c:forEach>
														</c:when>
														<c:otherwise>
															<ul class="userListClass">
																<c:forEach items="${versionLinksMap}" var="versionLink">
																	<li class="ui-state-default">${versionLink.value}</li>
																</c:forEach>
															</ul>
														</c:otherwise>
													</c:choose>
												</c:if>
											</div> 
										</td>
										<td class="spacingColumnWidthMedium"></td>
										<td colspan="3" align="left">
											<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; overflow: auto;">
												<span class="formLabel">Linked Documents:&nbsp;
												</span>
												<ul id="linkedDocId" class="userListClass">
												<c:forEach items="${linkedDocumentMap}" var="linkedDocumentMap">
													<li id="${linkedDocumentMap.key}" class="ui-state-default">${linkedDocumentMap.value}</li>
													<input type="hidden" name="linkedDocId" id="${linkedDocumentMap.key}" value="${linkedDocumentMap.key}">
												</c:forEach>
												</ul>
													
									   				
											</div>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>

									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="attrDetails"></tiles:insertAttribute>
									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="ownerDetails"></tiles:insertAttribute>
									
									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="viewValidityDetails"></tiles:insertAttribute>
									
									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tr class="formSpacingRow formBlockColor">
										<td class="spacingColumnWidthLess">&nbsp;</td>
										<td colspan="7">
											<table class="viewDetails">
													<tr class="heading">
														<th colspan="4">Vault Details</td>
													</tr>

													<tr class="even">
														<td colspan="2">Number</td>
														<td colspan="2">Location</td>
													</tr>
													<tr class="odd">
														<td colspan="2">${vaultDetails.vaultNumber}</td>
														<td colspan="2">${vaultDetails.vaultLocation}</td>
													</tr>
													<tr class="formSpacingRow formBlockColor"><td colspan="4" class="formBlockColor"></td></tr>
													<tr class="heading">
														<th colspan="4">Custodian Details</td>
													</tr>
													<tr class="even">
														<td>Name(Id)</td>
														<td>Designation</td>
														<td>Business Unit</td>
														<td>Department</td>
													</tr>
													<tr class="odd">
														<td>
															${vaultDetails.custodianName}(${vaultDetails.custodianId})
														</td>
														<td>${vaultDetails.custodianDesig}</td>
														<td>${vaultDetails.custodianLocName}</td>
														<td>${vaultDetails.custodianDepttName}</td>
													</tr>
												</table>
											</td>
										<td class="spacingColumnWidthLess">&nbsp;</td>
									</tr>
									<tr class="formSpacingRow formBlockColor"><td colspan="9"></td></tr>
									
									<!-- <tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									<tr>
										<td colspan="5"></td>
										<td colspan="3" align="right">
											<input type="reset" value="RESET" name="resetForm" class="resetButton">
											<span class="spacingColumnWidthLess">&nbsp;</span>
											<input type="hidden" value="ajaxRequest" name="ajaxSource">
											<input type="button" class="formButton ui-corner-all" value="UPLOAD" onclick="loadContentToServer('uploadNewDocForm','contentDiv')">	
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>	 -->												
								</table>
							</form:form>
					</div>
						</td>
				</table>
			</td>
		</tr>
	</table>
</div>





<%-- 
<div id="viewDocNorthPane" class="ui-layout-north ui-widget-header">
	<table class="tabsHeaderTable" >
		<tr>
			<td><span>View Document</span></td>
			<td class="spacingColumn">
			<td class="spacingColumn">
			<td class="spacingColumn">
			<td><input type="button" value="Back" onclick="javascript:viewDocumentDetail('0','back')"></td>
		</tr>
		<tr>
			
		</tr>
	</table>
	
</div>
	

	<form:form commandName="renewalDetailsForm" id="viewDocForm" action="${flowExecutionUrl}" enctype="multipart/form-data" method="POST">
		<div id="docDetailsTabs" class="ui-layout-center">
		<table cellpadding="0" cellspacing="0" border="0" width="90%">
			<tr>
				<td>
					<table>
						<tiles:insertAttribute name="attrDetails"></tiles:insertAttribute>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<hr/>
					<table>
						<tiles:insertAttribute name="ownerDetails"></tiles:insertAttribute>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<hr/>
					<table>
						<tiles:insertAttribute name="viewValidityDetails"></tiles:insertAttribute>
					</table>
				</td>
			</tr>
			<tr>
				<td>
				<hr/>
					<h5>Linked Documents</h5>
					<div id="linkedDocument">
						
						<ul id="linkedDocId" class="userListClass">
						<c:forEach items="${linkedDocumentMap}" var="linkedDocumentMap">
							<li id="${linkedDocumentMap.key}">${linkedDocumentMap.value}</li>
							<input type="hidden" name="linkedDocId" id="${linkedDocumentMap.key}" value="${linkedDocumentMap.key}">
						</c:forEach>
						</ul>
						<c:choose>
						<c:when test="${activityStatus}">
						<a target="_blank" href="downloadAttachment/${renewalDetailsForm.docId}.htm">${renewalDetailsForm.docName}</a>
						</c:when>
						<c:otherwise>
							No Rights On This Document
						</c:otherwise>
						</c:choose>
						
					</div>
				</td>
			</tr>
			<tr>
				<td>
				<hr/>
					<table class="viewDetails">
						<tr class="heading"><td colspan="4">Document Vault Details</td></tr>
						
						<tr class="even">
							<td colspan="2"> Number </td>
							<td colspan="2"> Location </td>
						</tr>
						<tr class="odd">
							<td colspan="2"> ${vaultDetails.vaultNumber}</td>
							<td colspan="2"> ${vaultDetails.vaultLocation} </td>
						</tr>
						<tr class="heading"><td colspan="4">Document Custodian Details</td></tr>
						<tr class="even">
							<td> Name(Id) </td>
							<td> Designation </td>
							<td> Business Unit </td>
							<td> Department </td>
						</tr>
						<tr class="odd">
							<td> ${vaultDetails.custodianName}(${vaultDetails.custodianId}) </td>
							<td> ${vaultDetails.custodianDesig} </td>
							<td> ${vaultDetails.custodianLocName} </td>
							<td> ${vaultDetails.custodianDepttName} </td>
						</tr>
					</table>
				</td>
			</tr>			
		</table>
	</div>	
</form:form> --%>